﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data.Mapping
{
    public partial class UserRedTransferBenefitMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<UserRedTransferBenefit>
    {
        public UserRedTransferBenefitMap()
        {
            ToTable("mc_UserRedTransferBenefit", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();

            Property(t => t.Amount)
              .HasPrecision(18, 6)
              .IsRequired();

            Property(t => t.BenefitRate)
              .HasPrecision(18, 6)
              .IsRequired();

            HasRequired(t => t.UserRedTransferHis)
               .WithMany()
               .HasForeignKey(d => d.TransferId)
               .WillCascadeOnDelete(false);

        }
    }
}
